package com.ziyucoding.springboot.labs.lab8.skywalking.springmvcdemo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 示例 控制器
 *
 * @author ziyucoding
 * @date 2022-10-31
 **/
@RestController
@RequestMapping("/demo")
public class DemoController {

    @GetMapping("/sayHi")
    public Map<String, Object> sayHi() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 0);
        result.put("msg", "成功");
        result.put("data", "hi");
        return result;
    }

    @GetMapping("/sayHello")
    public Map<String, Object> sayHello() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 0);
        result.put("msg", "成功");
        result.put("data", "hello");
        return result;
    }

}
